package com.nineclock.sign.controller;

import com.nineclock.api.sign.SignControllerApi;
import com.nineclock.common.entity.PageResult;
import com.nineclock.common.entity.Result;
import com.nineclock.sign.dto.SignPCListDTO;
import com.nineclock.sign.service.SignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;


@RestController
public class SignController implements SignControllerApi {

    @Autowired
    SignService signService;

    @Override
    @GetMapping("/sign")
    public Result<PageResult<SignPCListDTO>> queryMembers(String startTime, String endTime, Integer page, Integer pageSize) {
        PageResult<SignPCListDTO> pageResult = signService.queryMembers(startTime, endTime, page, pageSize);
        return Result.success(pageResult);
    }

    @Override
    @GetMapping("/export")
    public void exportSignData(String startTime, String endTime) throws IOException {
        signService.exportSignData(startTime,endTime);
    }
}
